<?php
class BanForm extends Zend_Form {
    public function __construct($options = null) 
    {
    	$baseurl 	= new MHDEV_View_Helper_BaseUrl();
    	$translate	= Zend_Registry::get('lang');
    	
        parent::__construct($options);
        
        $this->setName('ban');
        
        // user_uid
        $user_uid	= new Zend_Form_Element_Hidden('user_uid');
        
        // expire_date
        $expire		= new Zend_Form_Element_Text('expire_date');
        $expire->setLabel($translate->_('form_ban_expire'));

        // board_uid
        $board_uid 	= new Zend_Form_Element_Select('board_uid');
       	$board_uid->setRegisterInArrayValidator(false);
        $board_uid->setLabel($translate->_('form_ban_board'));
        $board_uid->addMultiOption('#', $translate->_('form_choose'));
        $board_uid->addMultiOption('all', $translate->_('admin_permission_allb'));
        
        // thread_uid
        $thread_uid	= new Zend_Form_Element_Hidden('thread_uid');
        
		// Text
        $text 		= new Zend_Form_Element_Textarea('reason');
		$text->setLabel($translate->_('form_ban_text'));
		$text->setRequired(true);
		$text->addFilter('StringTrim');
		$text->addValidator('NotEmpty');
		$text->setAttrib('rows','5');
		$text->setAttrib('cols','30');
		$text->setErrorMessages(array(
            0 => $translate->_('error_form_ban_text'),
        ));
        
       	// is deleted?
        $is_deleted	= new Zend_Form_Element_Checkbox('is_deleted');
        $is_deleted->setLabel($translate->_('form_ban_deleted'));
                
        // submit
        $submit 	= new Zend_Form_Element_Submit('submit');
        $submit->setLabel($translate->_('form_save'));

        
        $this->addElements(array($board_uid, $expire, $text, $is_deleted, $submit, $user_uid, $thread_uid));
    }
}  
?>